package com.jsoft.service.impl;

import com.jsoft.dao.TransferDao;
import com.jsoft.dao.impl.TransferDaoImpl;
import com.jsoft.entity.Transfer;
import com.jsoft.entity.Voucher;
import com.jsoft.service.TransferService;

import java.lang.invoke.VarHandle;
import java.util.List;

/**
 * @author:sha
 * @email:o68o4741@163.com
 * @date:2023/2/20
 */
public class TransferServiceImpl implements TransferService {
    private TransferDao transferDao = new TransferDaoImpl();
    @Override
    public int insertTransfer(Voucher voucher,Double amount,String remarkString,Integer receiveEnterpriseId) throws Exception {
        return transferDao.insertTransfer(voucher,amount,remarkString,receiveEnterpriseId);
    }

    @Override
    public String getFirstTransferNo() throws Exception {
        List<Transfer> transfers = transferDao.listTransferNo();
        return transfers.get(0).getNo();
    }
}
